package com.gitee.xhs.saveAndModifyingPointWriter.broadcastState;

import com.gitee.xhs.broadcastState.BroadcastStateDao;
import org.apache.flink.state.api.functions.BroadcastStateBootstrapFunction;

import static com.gitee.xhs.broadcastState.BroadcastStateConstant.BROADCAST_STATE_MAP_STATE_DESCRIPTOR;

/**
 * @author BigHead
 * @date 2022/7/11 17:26
 * @description BroadcastStateNewSavePointsFunction
 */
public class BroadcastStateNewSavePointsFunction extends BroadcastStateBootstrapFunction<BroadcastStateDao> {
    @Override
    public void processElement(BroadcastStateDao value, Context ctx) throws Exception {
        ctx.getBroadcastState(BROADCAST_STATE_MAP_STATE_DESCRIPTOR).put(value.getAccountId(), value);
    }
}
